Skip to content

chore: bump AdCP schemas to beta.5#889

Merged
bokelley merged 1 commit into
mainfrom
wire-version-catalog-tracking
May 27, 2026
Merged

chore: bump AdCP schemas to beta.5#889
bokelley merged 1 commit into
mainfrom
wire-version-catalog-tracking

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

  • bump the SDK schema pin from 3.1.0-beta.4 to 3.1.0-beta.5
  • regenerate schema cache and generated Python types from the beta.5 bundle
  • retarget the existing signal_owned manifest self-correction patch to beta.5
  • speed up post-generation fixes that were too slow on the regenerated bundle

Compatibility

Beta.5 is treated as its own schema contract, not as a beta.4 wire-compatible alias. The generated type delta report shows no beta.4 -> beta.5 field-shape changes.

Validation

  • ADCP_SKIP_SIGNATURE=1 make regenerate-schemas
  • PYTHONPATH=src pytest tests/test_adcp_version_option.py tests/test_validation_envelope.py tests/test_schema_loader_per_version.py tests/test_dispatcher_version_routing.py tests/test_adcp_version_wire.py tests/test_schemas_version_pin.py tests/test_public_api.py
  • ruff check src/adcp/_version.py src/adcp/validation/envelope.py src/adcp/validation/schema_loader.py scripts/post_generate_fixes.py tests/test_adcp_version_option.py tests/test_validation_envelope.py tests/test_schema_loader_per_version.py tests/test_dispatcher_version_routing.py
  • python3 -m py_compile src/adcp/types/_generated.py src/adcp/types/_ergonomic.py scripts/post_generate_fixes.py
  • pre-commit hooks during commit

while cursor < len(content):
line_end = content.find("\n", cursor)
if line_end == -1:
line_end = len(content)
while cursor < region_end:
line_end = content.find("\n", cursor, region_end)
if line_end == -1:
line_end = region_end
Copy link
Copy Markdown

@aao-ipr-bot aao-ipr-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Schema-cache refresh with zero wire-shape delta; alias layer survives the renumbering churn by construction.

Things I checked

  • No field-shape changes on the wire. ad-tech-protocol-expert byte-compared three bundled wire schemas (bundled/media-buy/create-media-buy-request.json, bundled/media-buy/get-products-response.json, bundled/creative/sync-creatives-request.json) between schemas/cache/3.1.0-beta.4/ and 3.1.0-beta.5/. Identical modulo _bundled.generatedAt, including required, top-level properties, and $defs keys. The empty SCHEMA_DELTAS.md is correct, not a tooling failure.
  • Alias-layer integrity. Every numbered class imported by aliases.py (AccountReference1/2, CreateMediaBuyResponse1/2/3, Deployment1/2, Destination1/2, AuthorizedAgents1..6, CatalogFieldBinding1, Field1) is present at matching positions in the regenerated _generated.py. The renumber churn (Signal81 → Signal, PricingOption341 → PricingOption211, etc.) lives in unaliased flat enum classes — true renumbering churn per the CLAUDE.md warning, no semantic delta.
  • chore: semver signal is correct. ADCP_VERSION is the protocol pin, not the SDK semver. aliases.py, capabilities.py, _ergonomic.py, _forward_compat.py, __init__.py all unchanged. No public Python API surface change.
  • Beta.4 cache preserved. 675 files added under schemas/cache/3.1.0-beta.5/, zero modified or removed under schemas/cache/3.1.0-beta.4/. Downstream tests pinned to beta.4 still resolve.
  • Layering rule held. Generated churn is confined to src/adcp/types/generated_poc/** and _generated.py. No non-allowlisted module gained an import from generated_poc.

Follow-ups (non-blocking — file as issues)

  • add_rootmodel_getattr_proxy swapped AST for regex and lost a robustness property (scripts/post_generate_fixes.py:543-600). The insertion point is computed as next_class.start() or len(source). If datamodel-codegen ever emits a module-level statement between a RootModel union class and the next class (e.g., FooAlias = FooUnion), source[:offset].rstrip() leaves the alias line intact and visually attaches the 4-space-indented def __getattr__ to it — IndentationError at module scope. I checked the current beta.5 generated tree and no RootModel union is followed by module-level code, so this is latent, not active. But the AST predecessor was robust to that shape; the regex version is not. Cheapest fix: keep AST for this one function — single per-file parse is small next to the rglob cost.
  • fix_deprecated_rootmodel_fields skips the first line of the annotation block (scripts/post_generate_fixes.py:1515-1521). _find_class_field_block returns start = annotation_start = cursor + len(" root: "), which is mid-line. The line-clear loop's line_start < start: continue always skips that first line. For multi-line RootModel root: Annotated[... annotations (what codegen currently emits), deprecated=True is never on that line. If codegen ever produces root: Field(deprecated=True, ...) single-line, Pydantic rejects it and this fix won't strip the deprecated=True. Worth tightening to a line-coverage check that doesn't require strict-less-than against a mid-line offset.
  • add_deprecated_field_metadata substring matcher loosened from Annotated[…]Field( to Field( substring (scripts/post_generate_fixes.py:282-285). Strictly more permissive than the predecessor. Currently fine — no deprecated field's annotation contains a Field(-suffixed identifier — but \bField\( would restore the prior precondition at near-zero cost.
  • SCHEMA_DELTAS.md is overwrite-only by design (scripts/diff_generated_types.py:202), so the beta.3→beta.4 delta the previous version recorded is gone from git history's working tree representation. For audit purposes, future bumps should fold the per-version delta into CHANGELOG.md so the cumulative trail survives the next regen.

Minor nits (non-blocking)

  1. add_rootmodel_getattr_proxy anchors on :\n to find the class header end (scripts/post_generate_fixes.py:573). Works because datamodel-codegen always emits class Foo(...):\n. A header ending in a trailing comment would break it. An assert or comment recording the assumption would make the dependency explicit.
  2. Conventional-commit title only narrates half of the PR. chore: bump AdCP schemas to beta.5 covers the version pin and the regen; the 333-line refactor in scripts/post_generate_fixes.py is independent perf work and is mentioned in the body but not the title. Not a semver issue — both pieces are chore:/refactor: grade — but the next reader of git log --oneline won't see that this commit also touched the build script. Notable for an otherwise-clean schema-bump PR; future bumps benefit from splitting.

Safe to merge.

@bokelley bokelley enabled auto-merge (squash) May 27, 2026 11:19
@bokelley bokelley merged commit bdf79ef into main May 27, 2026
25 checks passed
@bokelley bokelley deleted the wire-version-catalog-tracking branch May 27, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant